﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TrackPage : System.Web.UI.Page
{
    String id;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["id"] == null)
        {
            Response.Redirect("~/Default.aspx/");
        }
        else
        {
            id = Request["id"];
            List<Util.TrackInfo> oneTrack = new List<Util.TrackInfo>();
            BLL.Tracks forRep = new BLL.Tracks();
            oneTrack.Add(forRep.getTrack(id));
            BoughtTrack.DataSource = oneTrack;
            BoughtTrack.DataBind();
            
        }
    }
    protected void AddToFav_Click(object sender, EventArgs e)
    {
        BLL.Favorites favorite = new BLL.Favorites();
        favorite.addFavorite(new Util.Favorite() { UserID = HttpContext.Current.User.Identity.Name, FavoriteURI = "TrackPage.aspx/?id="+id, FavoriteName = new BLL.Tracks().getTrack(id).Name });
    }

    protected void Bay_Click(object sender, EventArgs e)
    {
    }
}